package com.infotel.test;

import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.swing.JComboBox;
import javax.swing.JFormattedTextField;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class PanneauDVD extends JPanel {

    /**
     * 
     */
    private static final long serialVersionUID = 1L;

    private JTextField textfieldTitre = null;
    private JTextField textfieldAuteur = null;
    private JFormattedTextField formattedtfPrix = null;
    private JComboBox<Integer> comboZone = null;
    private JFormattedTextField formattedtfDate = null;
    private SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy");

    public PanneauDVD() {

        
        this.setLayout(new GridBagLayout());
        JLabel labelTitre = new JLabel("Titre :");
        JLabel labelAuteur = new JLabel("Auteur :");
        JLabel labelPrix = new JLabel("Prix :");
        JLabel labelZone = new JLabel("Zone :");
        JLabel labelDateSortie = new JLabel("Date de sortie (jj/mm/aaaa) :");

         df = new SimpleDateFormat("dd/MM/yyyy");

        textfieldTitre = new JTextField();
        textfieldAuteur = new JTextField();
        formattedtfPrix = new JFormattedTextField(new Float(0));
        comboZone = new JComboBox<Integer>(new Integer[] { 1, 2, 3, 4, 5, 6 });
        formattedtfDate = new JFormattedTextField(df.format(new Date()));

        this.add(labelTitre, new GridBagConstraints(0, 0, 1, 1, 0, 0,
                GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,
                        0, 5, 5), 0, 0));
        this.add(labelAuteur, new GridBagConstraints(0, 1, 1, 1, 0, 0,
                GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,
                        0, 5, 5), 0, 0));
        this.add(labelPrix, new GridBagConstraints(0, 2, 1, 1, 0, 0,
                GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,
                        0, 5, 5), 0, 0));
        this.add(labelZone, new GridBagConstraints(0, 3, 1, 1, 0, 0,
                GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,
                        0, 5, 5), 0, 0));
        this.add(labelDateSortie, new GridBagConstraints(0, 4, 1, 1, 0, 0,
                GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,
                        0, 5, 5), 0, 0));
        this.add(textfieldTitre, new GridBagConstraints(1, 0, 10, 1, 0, 0,
                GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
                new Insets(0, 0, 5, 5), 0, 0));
        this.add(textfieldAuteur, new GridBagConstraints(1, 1, 1, 1, 0, 0,
                GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
                new Insets(0, 0, 5, 5), 0, 0));
        this.add(formattedtfPrix, new GridBagConstraints(1, 2, 1, 1, 0, 0,
                GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
                new Insets(0, 0, 5, 5), 0, 0));
        this.add(comboZone, new GridBagConstraints(1, 3, 1, 1, 0, 0,
                GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
                new Insets(0, 0, 5, 5), 0, 0));
        this.add(formattedtfDate, new GridBagConstraints(1, 4, 1, 1, 0, 0,
                GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
                new Insets(0, 0, 5, 5), 0, 0));

    }

    public SimpleDateFormat getDf() {
        return df;
    }

    public void setDf(SimpleDateFormat df) {
        this.df = df;
    }

    public JTextField getTextfieldTitre() {
        return textfieldTitre;
    }

    public void setTextfieldTitre(JTextField textfieldTitre) {
        this.textfieldTitre = textfieldTitre;
    }

    public JTextField getTextfieldAuteur() {
        return textfieldAuteur;
    }

    public void setTextfieldAuteur(JTextField textfieldAuteur) {
        this.textfieldAuteur = textfieldAuteur;
    }

    public JFormattedTextField getFormattedtfPrix() {
        return formattedtfPrix;
    }

    public void setFormattedtfPrix(JFormattedTextField formattedtfPrix) {
        this.formattedtfPrix = formattedtfPrix;
    }

    public JComboBox<Integer> getComboZone() {
        return comboZone;
    }

    public void setComboZone(JComboBox<Integer> comboZone) {
        this.comboZone = comboZone;
    }

    public JFormattedTextField getFormattedtfDate() {
        return formattedtfDate;
    }

    public void setFormattedtfDate(JFormattedTextField formattedtfDate) {
        this.formattedtfDate = formattedtfDate;
    }

}
